package com.bto.solar.work.utils;

import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.IdcardUtil;
import com.bto.solar.work.common.BizException;

/**
 * @author 王小波
 * @description:
 * @date 2023/8/21 15:11
 */
public class ValidUtils {
    public static void isIdCardNum(String idCardNum){
        if(!IdcardUtil.isValidCard(idCardNum)){
            throw new BizException("无效的身份证号码 {}"  ,idCardNum);
        }
    }

    public static void isPhoneNum(String phoneNum){
        if(!Validator.isMobile(phoneNum)){
            throw new BizException("无效的手机号 {}"  ,phoneNum);
        }
    }

}
